home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 05.zip
/
BS1 part 5
/
PDraw3.0.adf
/
pdraw_rex.lzh
/
StyleTagApply.pdrx
< prev
next >
Wrap
Text File
|
1992-06-15
|
3KB
|
109 lines
/*
@N
This Genie will apply a previously defined style to the current selection of objects.
*/
cr = '0a'x
styledb = "S:PDStyles.db"
call pdm_AutoUpdate(0)
call pdm_SetBatchMode(1)
/* initialize variables */
linecolor = ''
lineweight = ''
linepattern = ''
linejoin = ''
FillPattern = ''
if ~open(file, styledb, "r") then
exit_msg("No styles have been defined. Used AddStyleTag Genie to create a style tag.")
lines = ''
counter = 0
call pdm_ShowStatus("Reading style database..")
do while ~eof(file)
line = strip(readln(file))
if line = '' then iterate
parse var line stylename '@' line
lines = lines || cr || stylename
counter = counter + 1
linevals.counter.0 = stylename
linevals.counter.1 = line
end
call close(file)
if counter = 0 then
exit_msg("No styles have been defined. Used AddStyleTag Genie to create a style tag.")
lines = substr(lines,2)
nlines = min(max(counter, 5), 10)
stylename = pdm_SelectFromList("Select style to apply..", 30, nlines, 0, lines)
if stylename = '' then exit_msg()
do i = 1 to counter
if linevals.i.0 = stylename then leave
end
line = linevals.i.1
parse var line linecolor '@' lineweight '@' linepattern '@' linejoin '@' fillpattern '@'
colorlist = pdm_GetColorList()
if linecolor ~= '' then
do
parse var linecolor color ';' cdef ';'
parse var cdef red ',' green ',' blue ',' y ',' m ',' c ',' k ',' flag
if pos(color, colorlist) = 0 then
call pdm_DefineColor(color, red, green, blue, y, m, c, k, flag)
pdm_SetLineColor(, color)
end
if lineweight ~= '' then call pdm_SetLineWeight(, lineweight)
if linepattern ~= '' then call pdm_SetLinePattern(, word(linepattern, 1), subword(linepattern, 2))
if linejoin ~= '' then call pdm_SetLineJoin(, linejoin)
if fillpattern ~= '' then
do
parse var fillpattern type ';' cdef1 ';' color1 ';' cdef2 ';' color2 ';' steps ';' angle ';' centerx ';' centery ';'
parse var cdef1 red ',' green ',' blue ',' y ',' m ',' c ',' k ',' flag
if pos(color1, colorlist) = 0 then
call pdm_DefineColor(color1, red, green, blue, y, m, c, k, flag)
parse var cdef2 red ',' green ',' blue ',' y ',' m ',' c ',' k ',' flag
if pos(color2, colorlist) = 0 then
call pdm_DefineColor(color2, red, green, blue, y, m, c, k, flag)
call pdm_SetFillPattern(,type, color1, color2, steps, angle, centerx, centery)
end
exit_msg()
exit_msg: procedure
do
parse arg message
if message ~= '' then call pdm_inform(1,message,)
call pdm_SetBatchMode(0)
call pdm_ClearStatus()
call pdm_AutoUpdate(1)
exit
end